package com.example.zz.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author ${author}
 * @since 2021-01-14
 */
@Data
public class User implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * 编号主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 字符主键
     */
    @TableField(select = false)
    private String stringId;

    /**
     * 用户密码
     */
    private String password;

    /**
     * 认证外键
     */
    private Long attestationId;

    /**
     * 用户账号
     */
    private String userName;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 用户昵称
     */
    private String name;

    /**
     * 用户头像
     */
    private String userImage;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    /**
     * 乐观锁
     */
    private Integer version;

    /**
     * 逻辑删除
     */
    private Integer isDelete;

    public User(String stringId) {
        this.stringId = stringId;
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Long getAttestationId() {
        return attestationId;
    }

    public void setAttestationId(Long attestationId) {
        this.attestationId = attestationId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUserImage() {
        return userImage;
    }

    public void setUserImage(String userImage) {
        this.userImage = userImage;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    @Override
    public String toString() {
        return "User{" +
        "id=" + id +
        ", password=" + password +
        ", attestationId=" + attestationId +
        ", userName=" + userName +
        ", phone=" + phone +
        ", name=" + name +
        ", userImage=" + userImage +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        ", version=" + version +
        ", isDelete=" + isDelete +
        "}";
    }
}
